Add Cross-Origin-Opener/Embedder-Policy response headers#2008
Add Cross-Origin-Opener/Embedder-Policy response headers#2008davidism merged 1 commit intopallets:masterfrom
Conversation
|
Looks good overall. We're not using enums anywhere else, and there's no reference to them in the property docstrings, is it worth adding them right now? |
I think these are the only headers that are so constrained, can't think of when this would otherwise come up. I've updated the docstrings. I think these are helpful (I intend to make use of them). |
|
I was thinking about the cookie samesite property, I'm sure there's others too. If we do plan to add more, we might want to move them to an |
These header can only have a few distinct values, hence the use of an enum. They are more recent headers, and make it easier to control these policies (e.g. not having to write noopener everywhere). This code makes it a little easier to use the headers correctly - as the Enum fixes the values (preventing typos, mistakes etc). https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy
|
I see, that makes sense. I've update this - thanks for the suggestions. |
|
Thanks! |
These header can only have a few distinct values, hence the use of an
enum. They are more recent headers, and make it easier to control
these policies (e.g. not having to write noopener everywhere). This
code makes it a little easier to use the headers correctly - as the
Enum fixes the values (preventing typos, mistakes etc).
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy
CHANGES.rstsummarizing the change and linking to the issue... versionchanged::entries in any relevant code docs.pre-commithooks and fix any issues.pytestandtox, no tests failed.Please merge before #2005 if this is good to merge.